package com.lemon.exam.entity.po;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 菜单表 持久层对象
 *
 * @author Lemon
 * @since 2025/04/04 14:23:21
 */
@Getter
@Setter
@ToString
@Table(value = "sys_menu")
@Schema(name = "菜单表")
public class MenuPO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Id
    @Schema(description = "主键ID")
    @Column(value = "id")
    private Long id;

    @Schema(description = "路径")
    @Column(value = "path")
    private String path;

    @Schema(description = "父ID")
    @Column(value = "parent_id")
    @NotNull(message = "请选择父菜单")
    private Long parentId;

    @Schema(description = "菜单名称")
    @Column(value = "name")
    private String name;

    @Schema(description = "图标地址")
    @Column(value = "icon")
    @NotBlank(message = "请选择菜单图标")
    private String icon;

    @Schema(description = "排序")
    @Column(value = "seq")
    private Integer seq;

    @Schema(description = "树形菜单名称链")
    @Column(value = "tree_link_id")
    private String treeLinkId;

    @Schema(description = "创建人ID")
    @Column(value = "create_by")
    private String createBy;

    @Schema(description = "创建时间")
    @Column(value = "create_time")
    private LocalDateTime createTime;

    @Schema(description = "修改人ID")
    @Column(value = "update_by")
    private String updateBy;

    @Schema(description = "修改时间")
    @Column(value = "update_time")
    private LocalDateTime updateTime;

    @Schema(description = "状态：1启用 0停用")
    @Column(value = "status")
    private Integer status;

}
